<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page contentType="text/html;charset=UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
	<link href="themes/css/ui.common.css"
			rel="stylesheet" type="text/css" />
		<link href="themes/css/ui.child.css"
			rel="stylesheet" type="text/css" />
		<link href="themes/css/ui.tips.css"
			rel="stylesheet" type="text/css" />
		<link 
			href="style/jquery_ui/jquery-ui-1.8.custom.css"
			rel="stylesheet" type="text/css" />
		<link id="skin_css" rel="stylesheet" type="text/css"
			href="themes/css/ui.c.blue.css"></link>
		<link rel="stylesheet"
			href="themes/default/pagination.css"
			type="text/css"></link>
		<script
			src="Scripts/jquery-1.4.1.min.js"
			type="text/javascript"></script>
		<script
			src="Scripts/jquery-ui-1.8.custom.min.js"
			type="text/javascript"></script>

		<script src="Scripts/ui.tips.js"
			type="text/javascript"></script>
		<script src="Scripts/ui.default.js "
			type="text/javascript" charset="UTF-8"></script>
					<script src="Scripts/ui.admincp.js"
			type="text/javascript" charset="UTF-8"></script>
		<script src="js/ui.editableObject.js"
			type="text/javascript"></script>
		<script src="js/goodsOrderHandler.js"
			type="text/javascript"></script>
		<script
			src="js/bussiness.goodsReturn.js"
			type="text/javascript"></script>
		<STYLE type="text/css">
		.editorArea {
			display: none;
		}
		</STYLE>
		<script type="text/javascript"
			src="Scripts/ui.dialogFormHelper.js"></script>
		<title>查询财务信息</title>
		<SCRIPT type="text/javascript">
			function search(){
				if($("#yearSelector").val() == 0 && $("#monthSelector").val() == ''){
						alert("警告：请至少选择年份。");
						$("#yearSelector").focus();
						return;
				}
				if($("#monthSelector").val() != ''){
					if($("#yearSelector").val() == 0){
						alert("警告：请选择年份。");
						$("#yearSelector").focus();
						return;
					}
				}
				location="accountInfo!queryByManager.action?searchMonth="+$("#monthSelector").val()+"&searchYear="+$("#yearSelector").val()+"&inOrOut="+$("#inOrOutSelector").val();
			}
			function toQueryByInOrOrder(){
				location="accountInfo!queryByInOrOut.action";
			}
		</SCRIPT>
	</head>

	<body>
	 <div class="PageChild_Title">
        <img src=" themes/images/default/icons/archives.png" class="PageChild_Tbtnpic" />
        <span class="PageChild_separate"></span><span class="PageChild_TbtnText">
            <h2>查询财务信息</h2>
        </span><span class="PageChild_separate"></span>
        <div id="marker" class="red-tips">
        </div>
        <div class="clear">
        </div>
    </div>
    		<div align="center">
			<div class="PageChild_Where">
				<table>
					<tr>
						<td>
						年份:<s:select id="yearSelector"   list="#{2011:'2011',2010:'2010'}" headerKey="0" headerValue="-请选择-" name="searchYear" theme="simple"></s:select>
						月份:<s:select id="monthSelector" list="#{1:'1月份',2:'2月份',3:'3月份',4:'4月份',5:'5月份',6:'6月份',7:'7月份',8:'8月份',9:'9月份',10:'10月份',11:'11月份',12:'12月份'}" listKey="key" listValue="value"  headerKey="" headerValue="-请选择-" name="searchMonth" theme="simple"></s:select>
						入/出账:<s:select id="inOrOutSelector" name="inOrOut"   list="#{1:'入账',-1:'出账'}" headerKey="" headerValue="-全部-" theme="simple"></s:select>
						&nbsp;<button id="searchButton" class="o-btn" onclick="search()" >
						搜索
						</button> &nbsp;&nbsp;<button class="o-btn" onclick="toQueryByInOrOrder()">入/出账查看</button>
						</td>
					</tr>
				</table>
			</div>
		</div>
		<!-- 列表栏开始 -->
		<div class="PageChild_List">
			<table width="100%" border="0" cellspacing="0"
				style="text-align: left">
				<tbody class="PageChild_List_head">
					<tr>
						<td width="16">
							<img src="themes/images/default/icons/pcde_314.png" width="16"
								height="16" />
						</td>
						<td>
							账单标题
						</td>
						
						<td>
							金额
						</td>
						<td>
							日期
						</td>
						<td>
							出/入帐
						</td>
						<td>
							账单说明
						</td>
					</tr>
				</tbody>
				<tbody class="PageChild_List_main" style="text-align: left">
					<s:if test="accountList != null && accountList.size != 0">
					<s:iterator value="accountList" var="item" status="no">
						<tr class='td_no_bord'>
							<td class="td_width25">
								<s:property value="#no.count" />
							</td>
							<td>
								<span>${item.title}</span>
							</td>
							<td>
								<span>
									${item.price}</span>
							</td>
							<td>
								<span>${item.createTime} </span>
							</td>
							<td>
							<s:if test="#item.inOrOut==1">
							<span>入账 </span>
							</s:if>
								<s:if test="#item.inOrOut==-1">
							<span>出账 </span>
							</s:if>
							</td>
							<td>
								<span>
									${item.notes} </span>
							</td>
						</tr>
					</s:iterator>
						<tr>
							<td colspan="6">总计&nbsp;&nbsp;收入：${inTotal }元&nbsp;&nbsp;支出：${outTotal}元&nbsp;&nbsp;余额:<fmt:formatNumber value="${inTotal-outTotal}" pattern="#.0#"/>元</td>
						</tr>
					</s:if><s:else>
						<tr><td colspan="6">无记录</td></tr>
					</s:else>
				</tbody>
			</table>
		</div>
	</body>
</html>
